{extend name="default/template/base_index" /}

{block name="area_header"}
<script type="text/javascript" src="__CDN__/jquery-datetimepicker/jquery.datetimepicker.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="__CDN__/jquery-datetimepicker/jquery.datetimepicker.css">
{/block}

{block name="area_body"}
	{include file="default/Widget/topbar" /}
	<div class="admin-main container-fluid">
		{include file="default/Widget/left" /}
		<div class="admin-main-content">
			{include file="default/Widget/breadcrumb" /}
			<div class="table-responsive well">
				<h2>设备历史版本列表</h2>
	<!-- 过滤\查询按钮 -->
	<div class="filter-controls">
		<form action="{:url('SunsunDeviceVersion/morever')}" class="memberForm form-inline" method="post">

			<div class="form-group">
				<label class="control-label">设备版本{$version}</label>
				<select name="version" class="form-control" >
					<option value="">=全部=</option>
					{volist name="list" id="vo2"}
					<option {eq name="vo2['version']" value="$version"}selected{/eq} value="{$vo2.version}"> {$vo2.version}</option>
					{/volist}
				</select>
			</div>
			<div class="form-group ">
				<button type="submit" class="btn btn-default btn-sm"><i class="fa fa-search"></i>{:L('BTN_SEARCH')}</button>
			</div>
			<!--<div class="form-group">-->
				<!--<label class="control-label">&nbsp;</label>-->
				<!--<div class="input-group">-->
					<!--<button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-search"></i>查询</button>-->
				<!--</div>-->
			<!--</div>-->
		</form>
	</div>
				<div class="margin-sm clearfix">
					<a class="btn btn-default btn-sm" href="{:url('SunsunDeviceVersion/index')}" target="_self"><i class="fa fa-reply"></i>返回</a>


					<a href="{:url('SunsunDeviceVersion/add',array('device_type'=>$device_type))}" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i>添加</a>
				</div>

	<table class="table table-striped table table-hover  table-condensed">
		<thead>
			<tr>
				<th>
					设备类型
				</th>
				<th>
					设备名称
				</th>
				<th>
					更新包地址
				</th>
				<th>
					版本描述
				</th>
				<th>
					版本
				</th>
				<th>
					更新时间
				</th>
				<th>
					操作
				</th>
			</tr>
		</thead>
		<tbody>
			{empty name="list"}
				<tr>
					<td colspan="8" class="text-center">{:L('NO_DATA')}</td>
				</tr>
				{else/}
				{volist name="list" id="vo"}
					<tr>
						<td>{$vo.device_type}</td>
						<td>{$vo.device_name}</td>
						<td><a href="{$vo.url}" target="_blank">下载该版本</a></td>
						<td>{$vo.version_desc}</td>
						<td>{eq name="$vo['is_latest']" value="1"}
							<span class="btn btn-xs btn-danger">{$vo.version}【最新】</span>{else/}<span class="">{$vo.version}</span>{/eq}
						</td>
						<td>
							{:toDatetime($vo['update_time'])}
						</td>
						<td>
							<a href="{:url('SunsunDeviceVersion/latest',array('id'=>$vo['id'],'device_type'=>$vo['device_type']))}" class="ajax-get btn btn-sm btn-primary">设为最新版本</a>
							<a href="{:url('SunsunDeviceVersion/edit',array('id'=>$vo['id']))}" class="btn btn-sm btn-default"><i class="fa fa-edit"></i>编辑</a>
							<a href="{:url('SunsunDeviceVersion/delete',array('id'=>$vo['id']))}" class="ajax-get confirm btn btn-sm btn-danger"><i class="fa fa-trash"></i>删除</a>
						</td>
				{/volist}
			{/empty}
		</tbody>
	</table>
	<div>{$show}</div>
</div>
		</div>
		<!-- END admin-main-content -->
	</div>
		<!-- END admin-main-->
<script type="text/javascript">
	$(function() {

		$('#startdatetime').datetimepicker({
			lang: 'ch',
			format:'Y-m-d H:i:s',
			// format:'Y-m-d',
			// timepicker:false,
		});
		$('#enddatetime').datetimepicker({
			lang: 'ch',
			format:'Y-m-d H:i:s',
		});
	});
</script>
{/block}

{block name="area_footer"}

{/block}
